{% extends "home/common.html" %}
{% block content %}
	<!-- //网站头部 -->
        <!-- 使用jBox插件实现一个支付对话框 -->
    <script type="text/javascript" src="{{url_for('static',filename='home/js/jBox/jquery-1.4.2.min.js')}}"></script>
    <script type="text/javascript" src="{{url_for('static',filename='home/js/jBox/jquery.jBox-2.3.min.js')}}"></script>
    <link type="text/css" rel="stylesheet" href="{{url_for('static',filename='home/js/jBox/Skins2/Pink/jbox.css')}}" />
 <script type="text/javascript">
        // 获取总额
      
        function zhifu() {
            
            //设置对话框中要显示的内容
            var html = '<div class="popup_cont">'
                    + '<div style="width: 256px; height: 250px; text-align: center; margin:70px" >'
                    + '<image src="/static/home/images/qr.png" width="256" height="256" />'
                    + '<p style="color:red;padding-tope:30px">该页面仅为测试页面，并未实现支付功能</p></div>'
                    + '</div>';
            var content = {
                state1 : {
                    content : html,
                    buttons : {
                        '取消' : 0,
                        '支付' : 1
                    },
                    buttonsFocus : 0,
                    submit : function(v, h, f) {
                        if (v == 0) {//取消按钮的响应事件
                            return true; //关闭窗口
                        }
                        if (v == 1) {//支付按钮的响应事件
                            document.getElementById('myform').submit();//提交表单
                            return true;
                        }
                        return false;
                    }
                }
            };
            $.jBox.open(content, '支付', 400, 450);//打开支付窗口
        }
    </script>
    <div id="mr-mainbody" class="container mr-mainbody">
        <div class="row">
            <!-- 显示订单列表 -->
            <div id="mr-content" class="mr-content col-xs-12">
                <div id="mrshop" class="mrshop common-home">
                    <div class="container_oc">
                        <div class="row">
                            <div id="content_oc" class="col-sm-12">
                                <h1>我的订单</h1>
                                    <div class="table-responsive cart-info">
                                        <table class="table table-bordered">
                                            <thead>
                                                <tr>
                                                    <td class="text-center order_num">订单号</td>
                                                    <td class="text-center name">产品名称</td>
                                                    <td class="text-center number">购买数量</td>
                                                    <td class="text-center current_price">当前价格</td>
                                                    <td class="text-center total_amount">消费金额</td>
                                                    <td class="text-center recevie_name">收货人姓名</td>
                                                    <td class="text-center recevie_tel">收货人手机</td>
                                                    <td class="text-center addtime">下单日期</td>
                                                    <td class="text-center payment_status">支付状态</td>
                                                    
                                                </tr>
                                            </thead>
                                            <tbody>
                                                 {% for item in orders%}
                                                 <tr>
                                                    <td class="text-center order_num" width="10%">{{item.orders.order_num}}</td>
                                                    <td class="text-center name">{{item.goods.name}}</td>
                                                    <td class="text-center number">{{item.number}}件</td>
                                                    <td class="text-center current_price">{{item.goods.current_price}}元</td>
                                                    <td class="text-center total_amount">{{item.orders.total_amount}}元</td>

                                                    <td class="text-center recevie_name">{{item.orders.recevie_name}}</td>
                                                    <td class="text-center recevie_tel">{{item.orders.recevie_tel}}</td>
                                                    <td class="text-center addtime">{{item.orders.addtime}}</td>
                                                    <td class="text-center payment_status">
                                                        {% if item.orders.payment_status == '0' %}
                                                            <a href="javascript:zhifu()">待支付</a>
                                                        {% elif item.orders.payment_status == '1' %}
                                                            <a href="#">已支付支付</a>
                                                        {% endif %}
                                                    </td>
                                                    
                                                </tr>
                                                {% endfor %}
                                              <!--   <div>
                                                    {% if pagination.has_prev %}
                                                    <a href="{{ url_for('home.order_list', page=pagination.prev_num) }}">上一页</a>
                                                    {% else %}
                                                    <span>上一页</span>
                                                    {% endif %}

                                                    {% if pagination.has_next %}
                                                    <a href="{{ url_for('home.order_list', page=pagination.next_num) }}">下一页</a>
                                                    {% else %}
                                                    <span>下一页</span>
                                                    {% endif %}
                                                </div> -->
                                                {% if pagination.has_prev %}
                                                    <a href="{{ url_for('home.order_list', page=pagination.prev_num) }}">上一页</a>
                                                {% else %}
                                                    <span>上一页</span>
                                                {% endif %}

                                                {% if pagination.has_next %}
                                                    <a href="{{ url_for('home.order_list', page=pagination.page + 1) }}">下一页</a>
                                                    {{ pagination.next_num }}
                                                {% else %}
                                                    <span>下一页</span>
                                                {% endif %}
                                                
                                                <!-- 显示分页链接等其他分页相关信息 -->
                                                <!-- {{ pagination.links }} -->
<!-- 
                                                 显示分页信息 
                                                <p>当前页: {{ pagination.page }}</p>
                                                <p>每页显示数量: {{ pagination.per_page }}</p>
                                                <p>总记录数: {{ pagination.total }}</p> -->


                                            </tbody>
                                        </table>
                                    </div>
                            </div>
                        </div>
                        <br /><br />
                        <div class="row">
                            <div  class="col-sm-12">
                                <br />
                                <br />
                                <div class="buttons">
                                    <div class="pull-right">
                                        <a href="{{url_for('home.index')}}" class="tigger btn btn-primary btn-primary">继续购物</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        <!-- //显示订单列表 -->
        </div>
    </div>

   

{% endblock %}
